<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>边框影响盒子大小</title>
    <style>
        /* 加上边框，盒子变大，实际为220px */
        /* div {
            width: 200px;
            height: 200px;
            background-color: pink;

            border: 10px solid red;
        } */

        /* 盒子大小减去边框大小 */
        div {
            width: 180px;
            height: 180px;
            background-color: pink;

            border: 10px solid red;
        }
    </style>
</head>
<body>
    <div></div>
</body>
</html>